package org.codeart.apipassenger.remote;

import org.codeart.common.dto.OrderInfo;
import org.codeart.common.request.OrderRequest;
import org.codeart.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "service-order")
public interface ServiceOrderClient {

    @PostMapping("/order/add")
    R<Void> add(@RequestBody OrderRequest orderRequest, @RequestHeader("deviceCode") String deviceCode);

    @GetMapping("/real-time-order/{orderId}")
    R<Void> dispatchOrder(@PathVariable("orderId") Long orderId);

    @PostMapping("/order/cancel")
    R<Void> cancel(@RequestParam("orderId") Long orderId, @RequestParam("identity") String identity);

    @GetMapping("/order/detail")
    R<OrderInfo> detail(@RequestParam Long orderId);

    @GetMapping("/order/current")
    R<OrderInfo> current(@RequestParam String phone, @RequestParam String identity);
}
